package com.google.gwt.gfx.client.graphics.vml;

import com.google.gwt.gfx.client.graphics.Graphic;
import com.google.gwt.gfx.client.style.StrokeStyle;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;

public class VMLStrokeStyle extends StrokeStyle {

	public VMLStrokeStyle(Graphic g) {
		super(g);
	}

	public VMLStrokeStyle(Graphic g, Element element) {
		super(g, element);
	}

	@Override
	public String getColor() {
		return DOM.getElementProperty(element(), "color");
	}

	@Override
	public double getOpacity() {
		return Double.parseDouble(DOM.getElementProperty(element(), "opacity"));
	}

	@Override
	public int getWidth() {
		return DOM.getElementPropertyInt(element(), "weight");
	}

	@Override
	public void setColor(String color) {
		DOM.setElementProperty(element(), "color", color);
	}

	@Override
	public void setOpacity(double opacity) {
		DOM.setElementProperty(element(), "opacity", String.valueOf(opacity));
	}

	@Override
	public void setWidth(int width) {
		DOM.setElementPropertyInt(element(), "weight", width);
	}

}
